// 设计一个函数 获取上一页面的url
function get_before_url() {
    // document.referrer 获取上一页的url
     var before_url = document.referrer;
     console.log("获取的url是："+before_url);
    return before_url
}
var url = get_before_url();
//
// if(url === "{{ url }}/text_upload/"){
//     document.write("文本上传成功");
// }
// else if (url === "{{ url }}/img_upload/"){
//     document.write("图片上传成功");
// }
// else if(url === "{{ url }}/music_upload/"){
//     document.write("音频上传成功");
// }
// else if(url === "{{ url }}/video_Upload/"){
//     document.write("视频上传成功");
// }

//获取到 a标签对象
var a_herf = document.getElementById("already_a");


if(url === "{{ url }}/text_upload/"){
    // 改变p标签的内容
    document.getElementById("p_success").innerHTML="文本上传成功!";
    // 修改a标签的链接
    a_herf.href = "{{ url }}/text_successful/";

}
else if (url === "{{ url }}/img_upload/"){
    document.getElementById("p_success").innerHTML = "图片上传成功";
    a_herf.href = "{{ url }}/imgs_successful/";
}
else if(url === "{{ url }}/music_upload/"){
    document.getElementById("p_success").innerHTML = "音频上传成功";
    a_herf.href = "{{ url }}/music_successful/";
}
else if(url === "{{ url }}/video_Upload/"){
    document.getElementById("p_success").innerHTML = "视频上传成功";
   a_herf.href = "{{ url }}/video_successful/";
}
